package com.xoa.controller.party;


import com.xoa.model.party.EnOpenHole;
import com.xoa.service.party.EnOpenHoleService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Created by gsb on 2018/1/6.
 */
@Controller
@RequestMapping("/enOpenHole")
public class EnOpenHoleController {

    @Resource
    private EnOpenHoleService enOpenHoleService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午11:36:51
     * 类介绍  :   新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EnOpenHole> insertSelective(EnOpenHole enOpenHole, HttpServletRequest request, String gridLocation){
        return enOpenHoleService.insertSelective(enOpenHole, request,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午11:40:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EnOpenHole> deleteByPrimaryKey(Integer oid){
        return enOpenHoleService.deleteByPrimaryKey(oid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 上午11:40:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EnOpenHole> updateByPrimaryKeySelective(EnOpenHole enOpenHole, HttpServletRequest request, String gridLocation){
        return enOpenHoleService.updateByPrimaryKeySelective(enOpenHole, request,gridLocation);
    }

    @RequestMapping(value ="selectByList")
    @ResponseBody
    public ToJson<EnOpenHole> selectByList(EnOpenHole enOpenHole, Integer page, Integer pageSize,
                                           boolean useFlag, HttpServletRequest request, HttpServletResponse response){
        return enOpenHoleService.selectByList(enOpenHole, page, pageSize, useFlag, request, response);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午13:20:51
     * 类介绍  :   详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EnOpenHole> selectById(Integer oid){
        return enOpenHoleService.selectById(oid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午13:25:51
     * 类介绍  :   列表  或 导出 也可条件查询
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EnOpenHole> queryList(EnOpenHole enOpenHole, Integer page, Integer pageSize,
                                        boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return enOpenHoleService.queryList(enOpenHole, page, pageSize, useFlag, request, response, export);
    }

    @RequestMapping(value ="queryByList")
    @ResponseBody
    public ToJson<EnOpenHole> queryByList(){
        return enOpenHoleService.queryByList();
    }


    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午13:50:51
     * 类介绍  :   导入
     * 构造参数:
     *
     */
    @RequestMapping(value ="importEnOpenHole")
    @ResponseBody
    public ToJson<EnOpenHole> importEnOpenHole(MultipartFile file, HttpServletResponse response,
                                               HttpServletRequest request, HttpSession session){
        return enOpenHoleService.importEnOpenHole(file, response, request, session);
    }
}
